home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / modula2 / mod2src.arc / COMPILER.DOC < prev    next >
Text File  |  1987-04-30  |  14KB  |  346 lines

  1.  
  2. Logitech Modula-2/86 Compiler Rel 2.00 ******************************
  3.  
  4.      This is a high quality compiler that seems to do everything a
  5. good Modula-2 compiler should do.  The documentation is very com-
  6. plete but is very cryptic and has no definition of the language.
  7. Logitech has apparently redone the manual since our copy and it is,
  8. according to reports, much better.  We have used this compiler to
  9. develop a 2000 line program with no problems, so we can recommend
  10. it as a learning tool and a production system.
  11.  
  12.      To set up and run this compiler, simply follow the instructions
  13. as given in the manual then do the following steps if you want to use
  14. floating point numbers.  The instructions are buried in the notes and
  15. are not clear that this should be done.  This will use the emulators
  16. for the floating point operations.  The method will make it clear how
  17. you can use the 8087 libraries if you have them.
  18.  
  19. In the LNK directory;
  20.    COPY E87REALI.LNK REALINOU.LNK
  21.    COPY E87REALC.LNK REALCONV.LNK
  22.    COPY E87REALS.LNK REALS.LNK
  23.    COPY E87MATH0.LNK MATHLIB0.LNK
  24.  
  25. In the REF directory;
  26.    COPY E87REALI.REF REALINOU.REF
  27.    COPY E87REALC.REF REALCONV.REF
  28.    COPY E87REALS.REF REALS.REF
  29.    COPY E87MATH0.REF MATHLIB0.REF
  30.  
  31. ----------- Batch file used with the Logitech compiler ----------
  32. REM The next line is a call to your editor
  33. EDIT %1.MOD
  34. M2C %1
  35. IF ERRORLEVEL 1 GOTO ERROR
  36. M2L %1
  37. IF ERRORLEVEL 1 GOTO ERROR
  38. M2 %1
  39. PAUSE
  40. GOTO DONE
  41.  
  42. :ERROR
  43. REM Compile or Link error
  44. PAUSE
  45.  
  46. :DONE
  47. --------------------- End of batch file -------------------------
  48.  
  49. Following are the problems found in compiling the source files on
  50. your distribution disk.  All other files compile and run exactly
  51. as described in the text.
  52.  
  53. Chapter 3  - INTMATH.MOD  Logitech doesn't implement the MIN and MAX
  54.                      functions so you need to erase or comment out
  55.                      lines 34 and 35.
  56.  
  57. Chapter 3  - CARDMATH.MOD  Erase or comment out lines 44 and 45.
  58.  
  59. Chapter 3  - REALMATH.MOD  Erase or comment out lines 43 and 44.
  60.  
  61. Chapter 7  - OVERPROG.MOD  You can add a call to "Proc2" after
  62.                            line 8 because Logitech allows you to
  63.                            call a procedure prior to its being
  64.                            defined.
  65.  
  66. Chapter 7  - MOREPROG.MOD Same thing, after line 16.
  67.  
  68.  
  69. Prior to release of this tutorial, a preliminary copy was sent to
  70. Logitech for their comments.  Following is an exact copy of their
  71. reply to our letter dated April 14, 1987.  Since we do not have a
  72. copy of the newer version of their compiler, none of the comments
  73. in Mr. Cei's letter are acted upon anywhere in this tutorial, but
  74. are included for the student's information.  It would probably be
  75. wise to use the integrated environment provided by Logitech for
  76. software development.
  77.  
  78.                  (Start of letter from Logitech)
  79.  
  80. to:  Coronado Enterprises
  81.      12501 COronado Ave NE
  82.      Albuquerque, New Mexico 87122
  83.  
  84. re:  Modula2 Tutorial by Coronado Enterprises
  85.  
  86. Dear Sir,
  87.  
  88.     I thank you very much for reviewing the Logitech Modula2 system
  89. in your tutorial and for giving me the opportunity to comment on
  90. your review.  I am sure that the Modula2 will win more and more fans
  91. especially if material such as your tutorial is published.
  92.  
  93.     My first comment is that I feel that a discussion about the cur-
  94. rent release of the system would be more interesting and effective
  95. for your audience.  The current release is the 2.05 and it has been
  96. shipped since May, 1986.  The manual is hopefully better organized
  97. and more clear.  For instance, you will find a chapter on real arith-
  98. metic which talks about the 8087 Coprocessor/Emulator issue and about
  99. how to use the related libraries.
  100.  
  101.     Another point I would like to make is that our Modula2 system is
  102. an integrated system and not only a compiler.  Therefore, a typical
  103. user would probably not use a batch file (such as the one you list)
  104. to edit, compile and link a program.  Since the editor has the
  105. capability to syntax-check a M2 program, to invoke the compiler, the
  106. linker and to run the program, a user will find it very advantageous
  107. to work from within the editor.  Available are also valuable tools
  108. like a symbolic run-time debugger and a symbolic post-mortem debugger.
  109.  
  110.     Thank you very much for your attention.  I will be very pleased
  111. of any further discussion.
  112.  
  113.                                       Sincerely
  114.                                       (Signed)
  115.                                       Stefano Cei
  116.                                       S/W Development Manager
  117.  
  118.                   (End of letter from Logitech)
  119.  
  120.  
  121. FTL Modula-2 Compiler - Version 1.20 ********************************
  122.  
  123. The FTL compiler, marketed by Workman & Associates, is a very good
  124. implementation of the Modula-2 language.  It is extrememly fast in
  125. compiling and linking, and does everything we have asked it to do.
  126. It gives good diagnostics, but since line numbers are not given
  127. with error messages, it can be hard to track down an error in a
  128. large module.  Considering the selling price, it may be the best
  129. value in a compiler available on the market.  We have not used it
  130. for any large programs, but it works fine for all of the files in
  131. this tutorial.  It is definitely recommended as a learning tool,
  132. and we have no reason to not recommend it as a production tool other
  133. than the lack of experience in using it.
  134.  
  135. ------------ Batch file used with FTL Modula-2 ---------------
  136. REM The next line is used to call your editor
  137. EDIT %1.MOD
  138. M2 %1.MOD
  139. IF ERRORLEVEL 1 GOTO ERROR
  140. ML %1
  141. IF ERRORLEVEL 1 GOTO ERROR
  142. %1
  143. PAUSE
  144. GOTO DONE
  145.  
  146. :ERROR
  147. REM COMPILE OR LINK ERROR
  148. PAUSE
  149.  
  150. :DONE
  151. ---------------------End of Batch file ---------------------------
  152.  
  153. Following are all of the problems we encountered in compiling and
  154. running the source files included on the SOURCE disk.
  155.  
  156. Chapter 3 - REALMATH.MOD
  157.                 Line 5, Change MathLib0 to Maths
  158.                 Lines 5 & 22, Capitalize SIN & COS
  159.                 Comment out lines 43 & 44
  160.  
  161.  
  162. Chapter 8 - SIMPLOUT.MOD
  163.                 Line 12 - InOut.WriteString ....
  164.                 Line 17 - InOut.WriteLn;
  165.                 Line 4  - (delete)
  166.                   FTL will not allow both types of IMPORT in
  167.                 one module.
  168.  
  169.             SIMPLIN.MOD
  170.                 The input routines work different with FTL than
  171.                 with Logitech.  The resolution of the differences
  172.                 will be left to the student.
  173.  
  174.             FILEIO.MOD
  175.                 Change the following lines;
  176.                 Line 17 - OpenInput("Filename ---> ");
  177.                 Line 22 - OpenOutput("Filename ---> ");
  178.                 Include the extension when inputting the name.
  179.  
  180.             VARYFILE.MOD
  181.                 In order to use the "Streams" module, the following
  182.                 changes must be made to the module.
  183.                 Line 4  - FROM Streams IMPORT Connect,STREAM,
  184.                                Disconnect,ReadChar,EOS,Direction;
  185.                 Line 7  - ... ARRAY[0..13] ...
  186.                 Line 8  - InFile : STREAM;
  187.                 Line 10 - Reply : INTEGER;
  188.                 Line 16 - Reply := Connect(InFile,NameOfFile,input);
  189.                 Line 17 - UNTIL Reply = 0;
  190.                 Line 21 - IF NOT EOS(InFile)
  191.                 Line 24 - UNTIL EOS(InFile);
  192.                 Line 25 - Disconnect(InFile,TRUE);
  193.  
  194.             PRINTFLE.MOD
  195.                 Modify in the same manner as for VARYFILE.MOD and
  196.                 it will run correctly.  The actual mods will be
  197.                 left as an exercise for the student.
  198.  
  199.  
  200. Chapter 9 - TIMEDATE.MOD
  201.               Line 10 - FROM MsDos IMPORT Registers,MSDOS;
  202.               Line 17 - Regs : Registers;
  203.               Replace Lines 21 through 30 with;
  204.                Regs.AX := 02A00H;    (* code for get date *)
  205.                MSDOS(Regs);
  206.                Year := Regs.CX;
  207.                Month := Regs.DH;
  208.                Day := Regs.DL;
  209.                Regs.AX := 02C00H;    (* code for get time *)
  210.                MSDOS(Regs);
  211.                Hour := Regs.CH;
  212.                Minute := Regs.CL;
  213.                Second := Regs.DH;
  214.                Millisecond := 10 * Regs.DL;
  215.  
  216.             AREAS.MOD       These three programs don't use anything
  217.             PC.MOD        that is substantially different from the
  218.             LIST.MOD      other example programs, so they will be
  219.                           considered as programming exercises for the
  220.                           student if he should desire to attempt to
  221.                           make them work in the FTL system.
  222.  
  223.  
  224. Chapter 14 - WORDADDR.MOD
  225.                Line 10 - MonoVideo[0B000H] : ....
  226.                Line 11 - ColorVideo[0B800H] : ....
  227.                Line 30 - (delete)
  228.                  Since FTL uses a small memory model, it will not
  229.                support this program as written.
  230.  
  231.              ADRSTUFF.MOD
  232.                  Since FTL is very picky about TYPES, as it should
  233.                be, you must do the following conversions;
  234.                Add a new TYPE definition;
  235.                pCARDINAL = POINTER TO CARDINAL;
  236.                Line 29 - NeatPoint := pCARDINAL(CARDINAL(NeatPoint)
  237.                                                          + IncreAmt);
  238.                Lines 36 & 37 - Do the same TYPE conversions as for
  239.                          Line 29.
  240.  
  241. Chapter 15 - COROUT.MOD
  242.                Change the SYSTEM imports to read;
  243.                FROM SYSTEM IMPORT WORD, ADR, SIZE;
  244.                FROM Processes IMPORT PROCESS, NEWPROCESS, TRANSFER;
  245.  
  246.              COROUT2.MOD
  247.                Same as for COROUT.MOD
  248.  
  249.              COROUT3.MOD
  250.                Same as for COROUT.MOD
  251.  
  252.              INFINITE.MOD
  253.                Same as for COROUT.MOD
  254.  
  255.  
  256. Chapter 16 - None of these files have been compiled with the FTL
  257.              compiler as of this writing.  If you have completed
  258.              the entire tutorial, you should have no difficulty
  259.              in making the required changes to these programs in
  260.              order to use them as usable utility programs.
  261.  
  262.  
  263.  
  264.  
  265.  
  266. PCollier Modula-2 Compiler V1.0 *************************************
  267.  
  268. Even though this seems to be a working compiler, it does have a few
  269. shortcomings.  It is too picky about type checking, not allowing
  270. type conversion between INTEGER and CARDINAL in the implied type of
  271. a FOR loop.  The diagnostic messages given are generally not very
  272. clear nor is it clear where the problem is.  Little effort was spent
  273. tracking down all of the problems because we quickly lost interest
  274. in this system due to the confusing diagnostic messages.
  275.  
  276. -------------- Batch file used with PCollier ------------------------
  277. REM The following line is a call to your editor
  278. EDIT %1.MOD
  279. M2PC %1/RN /Z
  280. IF ERRORLEVEL 1 GOTO ERROR
  281. M2X %1
  282. PAUSE
  283. GOTO DONE
  284.  
  285. :ERROR
  286. REM ERROR FOUND IN COMPILER PASS
  287. PAUSE
  288. :DONE
  289. --------------------- End of batch file -----------------------------
  290.  
  291. Following are some of the problems encountered in compiling and
  292. running the files included on the SOURCE disk.
  293.  
  294. Chapter 6  - ARAYPASS.MOD  Index needs to be a CARDINAL in line 42
  295.                            but it must be an INTEGER in line 46.
  296.                            The same variable cannot be used in both
  297.                            places without an error.  Define a new
  298.                            variable of type CARDINAL for use in
  299.                            lines 42 & 43.
  300.  
  301. Chapter 6  - STRINGEX.MOD  This is an example of a compiler writer
  302.                            defining a Library Module differently
  303.                            from another writer.  It will require
  304.                            you to read the documentation and change
  305.                            the procedure calls to those defined by
  306.                            the PCollier writers.
  307.  
  308. Chapter 9  - None of these files have been compiled or debugged with
  309.              this compiler.  It will be left up to you to debug them
  310.              if you so choose.
  311.  
  312. Chapter 10 - SUBRANGE.MOD  The diagnostic received here makes no
  313.                            sense.
  314.  
  315. Chapter 10 - SETS.MOD      The diagnostic received here makes no
  316.                            sense.
  317.  
  318. Chapter 13 - CIRCLES.DEF   Remove the EXPORT list.  The exporting
  319.                            is done for you automatically.
  320.  
  321. Chapter 14 - TYPEREL.MOD   The type transfer functions do not work
  322.                            the way they should, and the diagnostic
  323.                            messages are unclear.
  324.  
  325. Chapter 14 - WORDADDR.MOD  Remove line 30.
  326.  
  327. Chapter 14 - ADRSTUFF.MOD  The type checking is inconsistent.  It is
  328.                            not clear what the problems are that the
  329.                            compiler doesn't like in this file.
  330.  
  331. Chapter 15 - All Files     Modify the IMPORT list as follows;
  332.                 FROM SYSTEM   IMPORT WORD, ADR;
  333.                 FROM Transfer IMPORT PROCESS, NEWPROCESS, TRANSFER;
  334.  
  335.                    These changes will still not make the programs
  336.                 work, but they will compile without error.  We lack
  337.                 the time and interest to continue debugging.
  338.  
  339. Chapter 16 - None of these files have been compiled with this
  340.              compiler as of this writing.  If you have completed
  341.              the entire tutorial, you should be able to make the
  342.              required changes to these programs in order to use
  343.              them as utility programs.
  344.  
  345.  
  346.